import request from '@/utils/request'

// 登录接口
export const GetUserinfo = data => {
  return request({
    url: '/api/userinfo',
    method: 'post',
    data,
  })
}

// 登录接口
export const Login = data => {
  return request({
    url: '/user/login',
    method: 'post',
    data,
  })
}


//项目 配置
export const AppConfig = data => {
  return request({
    url: '/config/get',
    method: 'post',
    data,
  })
}


// 存储柜门 接口
export const CabientQuery = data => {
  return request({
    url: '/cabinet/list',
    method: 'post',
    data,
  })
}

// 开始扫描 接口
export const CabinetScan = data => {
  return request({
    url: '/task/cabinet/scan',
    method: 'post',
    data,
  })
}

// ocr 识别列表 接口
export const CabinetTaskQuery = data => {
  return request({
    url: '/cabinet/task/list',
    method: 'post',
    data,
  })
}


// ocr 识别列表 接口
export const CabinetTaskStart = data => {
  return request({
    url: '/cabinet/task/start',
    method: 'post',
    data,
  })
}


// ocr 识别 进度 接口
export const CabinetTaskProgress = data => {
  return request({
    url: '/cabinet/task/progress',
    method: 'post',
    data,
  })
}

// 档案柜 列表 查询
export const CabinetQuery = data => {
  return request({
    url: '/cabinet/list',
    method: 'post',
    data,
  })
}

// 档案柜 新建
export const CabinetAdd = data => {
  return request({
    url: '/cabinet/add',
    method: 'post',
    data,
  })
}
// 档案柜 编辑
export const CabinetEdit = data => {
  return request({
    url: '/cabinet/update',
    method: 'post',
    data,
  })
}


// 档案柜 删除
export const CabinetDel = data => {
  return request({
    url: '/cabinet/del',
    method: 'post',
    data,
  })
}

// 档案柜 详情
export const CabinetDetail = data => {
  return request({
    url: '/cabinet/box/list',
    method: 'post',
    data,
  })
}

// 系统 配置
export const getConfigData = data => {
  return request({
    url: '/config/get',
    method: 'post',
    data,
  })
}

// 设置 系统 配置
export const setConfigData = data => {
  return request({
    url: '/config/set',
    method: 'post',
    data,
  })
}


// 测试连接 orc 服务
export const connect_server = data => {
  return request({
    url: '/test/connect_server',
    method: 'get',
    data,
  })
}


export const SearchDataCriteria = data => {
  return request({
    url: '/project/search/criteria',
    method: 'post',
    data,
  })
}

export const SearchQuery = data => {
  return request({
    url: '/project/seniorQuery',
    method: 'post',
    data,
  })
}

// 项目文档 查询
export const projectDocumentGet = data => {
  return request({
    url: '/document/seniorGet',
    method: 'post',
    data,
  })
}

// 下载记录 查询
export const DownloadQuery = data => {
  return request({
    url: '/file_download/query',
    method: 'post',
    data,
  })
}
// 下载记录 添加
export const DownloadAdd = data => {
  return request({
    url: '/file_download/add',
    method: 'post',
    data,
  })
}
// 下载记录 下载文件
export const DownloadFile = data => {
  return request({
    url: '/file_download/file/'+data,
    method: 'get',
  })
}

// 查询 档案柜  列表
export const CabinetAllQuery = data => {
  return request({
    url: '/cabinet/queryAll',
    method: 'post',
  })
}

// 下载列表 打开文件夹
export const openFile = data => {
  return request({
    url: '/file_download/openFile',
    method: 'post',
    data
  })
}

